<template>
  <el-select v-model="value" clearable placeholder="选择分类" @change="change">
    <el-option
      v-for="item in options"
      :key="item.value"
      :label="item.label"
      :value="item.value">
    </el-option>
  </el-select>
</template>

<script>
/*eslint-disable*/
  export default {
    name: "SelectCategory",
    data(){
      return {
        options: [{
          value: '选项1',
          label: '碗'
        }, {
          value: '选项2',
          label: '瓶'
        }, {
          value: '选项3',
          label: '笔筒'
        }],
        value: ''
      }
    },
    methods: {
      change(val) {
        let selectName=this.options.find(item => item.value == val).label
        this.$emit('selectName',selectName)
      }
    },
  }
</script>

<style scoped>

</style>
